/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rekap;

import com.view.*;
import com.model.Member;
import com.model.Pesanan;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Satellite
 */
public class TableModelPesanan extends AbstractTableModel {

    private List<Pesanan> kategoris = new ArrayList<Pesanan>();

    public TableModelPesanan(List<Pesanan> kategoris) {
        this.kategoris = kategoris;
    }

    public int getRowCount() {
        return kategoris.size();
    }

    public int getColumnCount() {
        return 11;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Pesanan b = kategoris.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return b.getTelp();
            case 1:
                return b.getId_pesanan();
            case 2:
                return b.getNama();
            case 3:
                return b.getPaket();
            case 4:
                return b.getJadi();
            case 5:
                return b.getJumlah();
            case 6:
                return b.getTotal();
            case 7:
                return b.getAlamat();
            case 8:
                return b.getId_member();
            case 9:
                return b.getStatus();
            case 10:
                return b.getPengiriman();
            default:
                return "";
        }
    }

    @Override
    public String getColumnName(int column) {
        switch (column) {
            case 0:
                return "NoTelp";
            case 1:
                return "ID Pesanan";
            case 2:
                return "Nama";
            case 3:
                return "Paket";
            case 4:
                return "Tanggal Jadi";
            case 5:
                return "Jumlah";
            case 6:
                return "Harga Total";
            case 7:
                return "Alamat";
            case 8:
                return "ID Member";
            case 9:
                return "Status";
            case 10:
                return "Pengiriman ";
            default:
                return "";
        }
    }
}
